import aiRequest from '@/utils/request/aiIndex'
import Request from '@/utils/request'

//发送对话消息
export function chatMessages(data: any) {
    return aiRequest.post({ url: '/chat-messages', data }, { isReturnDefaultResponse: true })
}

//获取应用基本信息
export function info() {
    return aiRequest.get({ url: '/info' })
}

//获取应用参数
export function parameters() {
    return aiRequest.get({ url: '/parameters' }, { isReturnDefaultResponse: true })
}

// 获取下一轮建议问题列表
export function suggested(message_id: any, data: any) {
    return aiRequest.get(
        { url: `/messages/${message_id}/suggested`, data },
        { isReturnDefaultResponse: true }
    )
}
// 停止响应
export function stop(task_id: any, data: any) {
    return aiRequest.post(
        { url: `/chat-messages/:${task_id}/stop`, data },
        { isReturnDefaultResponse: true }
    )
}
// 删除会话
export function deleteConversation(conversation_id: any, data: any) {
    return aiRequest.delete(
        { url: `/conversations/${conversation_id}`, data },
        { isReturnDefaultResponse: true }
    )
}

//获取开场白
export function PromptConfig(data: any) {
    return Request.post({ url: '/prompt/config', data }, { isAuth: false })
}

// 获取用户历史
export function getHistory(data: any) {
    return aiRequest.get({ url: `/conversations`, data }, { isReturnDefaultResponse: true })
}
// 获取会话历史消息
export function getMessages(data: any) {
    return aiRequest.get({ url: `/messages`, data }, { isReturnDefaultResponse: true })
}
// 获取平台入驻租户所有应用
export function getTenantApplications(data: any) {
    return Request.get({ url: `/index/applications`, data }, { isReturnDefaultResponse: true })
}
